
import React, { useMemo } from 'react';
import AuthRouter from './component/authRouter/route-authentication';
import bootStarp from './bootstrap';
import { App as AntdApp } from "antd"
import { Context, globalModal } from './data';

bootStarp();




function App() {
    const { message, modal, notification } = AntdApp.useApp();
    const { Provider } = Context;

    // 同步更新全局引用
    useMemo(() => {
        globalModal.methods = {
            modal: modal,
            confirm: ({ title, content, onOk, onCancel, ...props }) => modal.confirm({ title, content, onOk, onCancel, ...props })
        };
    }, []);

    return (
        <>
            <Provider
                value={{
                    message, modal, notification
                }}>
                <AuthRouter />
            </Provider>
        </>

    );
}

export default App;

